<?php

/**
 * ContactPerson form base class.
 *
 * @package    form
 * @subpackage contact_person
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BaseContactPersonForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                   => new sfWidgetFormInputHidden(),
      'position_title'       => new sfWidgetFormInput(),
      'work_unit'            => new sfWidgetFormInput(),
      'trunk_line_modifier'  => new sfWidgetFormInput(),
      'trunk_line_number'    => new sfWidgetFormInput(),
      'trunk_line_extension' => new sfWidgetFormInput(),
      'person_id'            => new sfWidgetFormDoctrineChoice(array('model' => 'Person', 'add_empty' => false)),
      'contact_person_id'    => new sfWidgetFormInput(),
      'created_at'           => new sfWidgetFormDateTime(),
      'updated_at'           => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                   => new sfValidatorDoctrineChoice(array('model' => 'ContactPerson', 'column' => 'id', 'required' => false)),
      'position_title'       => new sfValidatorString(array('max_length' => 255)),
      'work_unit'            => new sfValidatorString(array('max_length' => 255)),
      'trunk_line_modifier'  => new sfValidatorInteger(),
      'trunk_line_number'    => new sfValidatorInteger(),
      'trunk_line_extension' => new sfValidatorInteger(),
      'person_id'            => new sfValidatorDoctrineChoice(array('model' => 'Person')),
      'contact_person_id'    => new sfValidatorInteger(),
      'created_at'           => new sfValidatorDateTime(array('required' => false)),
      'updated_at'           => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('contact_person[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'ContactPerson';
  }

}
